package cn.koala.key.receipt.controller;

import cn.koala.key.entity.BorrowOrderAddressee;
import cn.koala.key.receipt.service.BorrowOrderAddresseeService;
import cn.seed.common.core.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @description:借用单使用信息
 *
 * @author 32415
 * @time 2019/04/28
 **/
@RestController
@RequestMapping("/borrow-order-addressees")
@Api(value = "BorrowOrderAddressee",tags = "借用单使用信息")
public class BorrowOrderAddresseeController {

    @Autowired
    private BorrowOrderAddresseeService borrowOrderAddresseeService;

    @ApiOperation(value = "借用单详情")
    @GetMapping("/{orderNo}")
    public Result<BorrowOrderAddressee> detail(@ApiParam("借用单号") @PathVariable String orderNo) {
        return borrowOrderAddresseeService.getByOrderNo(orderNo);
    }

    @ApiOperation(value = "编辑归还信息")
    @PutMapping()
    public Result edit(@RequestBody BorrowOrderAddressee borrowOrderAddressee) {
        return borrowOrderAddresseeService.edit(borrowOrderAddressee);
    }
}
